#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
#if defined(__LINUX__) || defined(__APPLE__) || defined(__unix__)
#include<dirent.h>
#elif defined(_WIN32) || defined(__WIN64__) || defined(__WINDOWS__)
#include <direct.h> // _getcwd
#endif

namespace xk {
    //读写文件练习
    namespace file {
        //获取当前工作目录 #include<dirent.h>
        std::string getCWD() {
            char *buffer;
            //也可以将buffer作为输出参数 #include<dirent.h>
            if ((buffer = _getcwd(nullptr, 0)) == nullptr) {
                return {""};
            }
            return {buffer};
        }

        // std::string read_file(const std::string &filename) {
        // }


    }
}

int main() {
    using namespace xk;
    using namespace file;
    std::cout << file::getCWD() << std::endl;
    return 0;
}

//c++ -I /Library/WebServer/Documents/boost_1_82_0 example.cpp -o example
